package com.anywide.service.user.impl;
import java.sql.SQLException;
import java.util.List;

import javax.annotation.Resource;

import com.anywide.bean.user.User;
import com.anywide.dao.user.UserDAO;
import com.anywide.dawdler.serverplug.annotation.DBTransaction;
import com.anywide.service.user.UserService;
public class UserServiceImpl implements UserService {
	
//	@RemoteService(remote=true)
//	private UserService userService;
	
	@Resource
	UserDAO userDAO;
//	@DBTransaction(mode=MODE.forceReadOnWrite,propagation=Propagation.REQUIRED)
//	@DBTransaction(readConfig=READCONFIG.deferToConfig,propagation=Propagation.REQUIRES_NEW)
	@DBTransaction
	public List<User> selectUser() throws SQLException{
//		List list  = userService.selectUser();
		return userDAO.queryListPrepare("select * from user limit 0,10",User.class);
	}
	@Override
	@DBTransaction
	public List<User> selectUser(User user) throws SQLException {
		System.out.println(user.getNickname());
		return selectUser();
	}
	
}
